package com.example.shorg.utils;

import com.example.shorg.vo.ResultVO;

/**
 * 结果统一处理
 * */
public class ResultVOUtils {

    public static ResultVO success(Object object){
        ResultVO<Object> resultVO = new ResultVO<>();
        resultVO.setData(object);
        resultVO.setCode(200);
        resultVO.setMsg("处理成功");
        return resultVO;
    }

    /***
     * 返回空的情况
     * */
    public static ResultVO success(){
        return null;
    }

    public static ResultVO error(Integer code, String msg){
        ResultVO<Object> objectResultVO = new ResultVO<>();
        objectResultVO.setCode(code);
        objectResultVO.setMsg(msg);
        return objectResultVO;
    }
}
